<div class="deliveries view">
<h2><?php  echo __('Delivery'); ?></h2>
	<dl>
		<dt><?php echo __('Id'); ?></dt>
		<dd>
			<?php echo h($delivery['Delivery']['id']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Order'); ?></dt>
		<dd>
			<?php echo $this->Html->link($delivery['Order']['id'], array('controller' => 'orders', 'action' => 'view', $delivery['Order']['id'])); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Item'); ?></dt>
		<dd>
			<?php echo $this->Html->link($delivery['Item']['name'], array('controller' => 'items', 'action' => 'view', $delivery['Item']['id'])); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Delivery Status'); ?></dt>
		<dd>
			<?php echo $this->Html->link($delivery['DeliveryStatus']['name'], array('controller' => 'delivery_statuses', 'action' => 'view', $delivery['DeliveryStatus']['id'])); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Tracking'); ?></dt>
		<dd>
			<?php echo h($delivery['Delivery']['tracking']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Note'); ?></dt>
		<dd>
			<?php echo h($delivery['Delivery']['note']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Created'); ?></dt>
		<dd>
			<?php echo h($delivery['Delivery']['created']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Modified'); ?></dt>
		<dd>
			<?php echo h($delivery['Delivery']['modified']); ?>
			&nbsp;
		</dd>
	</dl>
</div>
<div class="actions">
	<h3><?php echo __('Actions'); ?></h3>
	<ul>
		<li><?php echo $this->Html->link(__('Edit Delivery'), array('action' => 'edit', $delivery['Delivery']['id'])); ?> </li>
		<li><?php echo $this->Form->postLink(__('Delete Delivery'), array('action' => 'delete', $delivery['Delivery']['id']), null, __('Are you sure you want to delete # %s?', $delivery['Delivery']['id'])); ?> </li>
		<li><?php echo $this->Html->link(__('List Deliveries'), array('action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Delivery'), array('action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Orders'), array('controller' => 'orders', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Order'), array('controller' => 'orders', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Items'), array('controller' => 'items', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Item'), array('controller' => 'items', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Delivery Statuses'), array('controller' => 'delivery_statuses', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Delivery Status'), array('controller' => 'delivery_statuses', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Sales'), array('controller' => 'sales', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Sale'), array('controller' => 'sales', 'action' => 'add')); ?> </li>
	</ul>
</div>
<div class="related">
	<h3><?php echo __('Related Sales'); ?></h3>
	<?php if (!empty($delivery['Sale'])): ?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php echo __('Id'); ?></th>
		<th><?php echo __('Delivery Id'); ?></th>
		<th><?php echo __('Customer Id'); ?></th>
		<th><?php echo __('Sale Price'); ?></th>
		<th><?php echo __('Locaion Id'); ?></th>
		<th><?php echo __('Balance'); ?></th>
		<th><?php echo __('Sale Original Price'); ?></th>
		<th><?php echo __('Sale Type'); ?></th>
		<th><?php echo __('Discount Amout'); ?></th>
		<th><?php echo __('Discount Type'); ?></th>
		<th><?php echo __('Created'); ?></th>
		<th><?php echo __('Modified'); ?></th>
		<th class="actions"><?php echo __('Actions'); ?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($delivery['Sale'] as $sale): ?>
		<tr>
			<td><?php echo $sale['id']; ?></td>
			<td><?php echo $sale['delivery_id']; ?></td>
			<td><?php echo $sale['customer_id']; ?></td>
			<td><?php echo $sale['sale_price']; ?></td>
			<td><?php echo $sale['locaion_id']; ?></td>
			<td><?php echo $sale['balance']; ?></td>
			<td><?php echo $sale['sale_original_price']; ?></td>
			<td><?php echo $sale['sale_type']; ?></td>
			<td><?php echo $sale['discount_amout']; ?></td>
			<td><?php echo $sale['discount_type']; ?></td>
			<td><?php echo $sale['created']; ?></td>
			<td><?php echo $sale['modified']; ?></td>
			<td class="actions">
				<?php echo $this->Html->link(__('View'), array('controller' => 'sales', 'action' => 'view', $sale['id'])); ?>
				<?php echo $this->Html->link(__('Edit'), array('controller' => 'sales', 'action' => 'edit', $sale['id'])); ?>
				<?php echo $this->Form->postLink(__('Delete'), array('controller' => 'sales', 'action' => 'delete', $sale['id']), null, __('Are you sure you want to delete # %s?', $sale['id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $this->Html->link(__('New Sale'), array('controller' => 'sales', 'action' => 'add')); ?> </li>
		</ul>
	</div>
</div>
